package cn.qayy.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import cn.qayy.dao.WxClientMapper;
import cn.qayy.dao.WxPrizeMapper;
import cn.qayy.dto.PrizeDTO;
import cn.qayy.po.WxClient;
import cn.qayy.po.WxPrize;
import cn.qayy.service.IPrizeService;
import cn.qayy.utils.DownLoadUtil;

/***
 * @author wy
 *
 */
@SuppressWarnings("all")
@Service("prizeServiceImpl")
public class PrizeServiceImpl implements IPrizeService {

	@Resource
	public WxPrizeMapper wxPrizeMapper;

	@Override
	public PageInfo<WxPrize> selectPrizeBy(PrizeDTO dto) throws Exception {
		if (dto != null) {
			DownLoadUtil.set("PrizeDTO",dto);
			PageHelper.startPage(dto.getPageNumber(), dto.getPageSize());
			List<WxPrize> list = wxPrizeMapper.selectPrizeBy(dto);
			PageInfo<WxPrize> pageInfo = new PageInfo<WxPrize>(list);
			return pageInfo;
		}
		return null;
	}

	
	@Override
	public int insertByList(List list) throws Exception {
		return wxPrizeMapper.insertByList(list);
	}

	@Override
	public int updateByList(List list) throws Exception {
		return wxPrizeMapper.updateByList(list);
	}

	@Override
	public int deleteByList(List list) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int insert(Object bean) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int update(Object bean) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int delete(Object bean) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<PrizeDTO> selectPrizeForDown(Map<String, Object> params) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}


	/*@Override
	public List<WxPrize> selectByMap(Map<String, Object> params) {
		return wxPrizeMapper.selectByMap(params);
	}*/

	@Override
	public List<Integer> selectIdsByMap(Map<String, Object> params) {
		return wxPrizeMapper.selectIdsByMap(params);
	}

	@Override
	public WxPrize selectPrizeByID(Integer gfId) throws Exception {
		return wxPrizeMapper.selectByPrimaryKey(gfId);
	}

}
